package com.roamer.audition.job.task;

import com.roamer.audition.common.response.AuditionRecordDetailVO;
import com.roamer.audition.common.service.AuditionRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 定时任务
 *
 * @author roamer
 * @version V1.0
 * @date 2019/8/23 1:19 下午
 */
@Slf4j
@Component
public class ScheduledTasks {

    private final AuditionRecordService auditionRecordService;

    public ScheduledTasks(AuditionRecordService auditionRecordService) {
        this.auditionRecordService = auditionRecordService;
    }

    /**
     * 推送到发送消息的延迟队列
     * 凌晨五点开始每小时执行一次
     */
    @Scheduled(cron = "59 59 23 L * ?")
    public void pushSmsQueue() {
        List<AuditionRecordDetailVO> detailList = auditionRecordService.getNearAuditionList(50);

    }
}
